const http = require('http');
const io = require('socket.io');

// 1 - create http server
let httpServer = http.createServer();

httpServer.listen(9090);

// 2 - create socket server 
let wsServer = io.listen(httpServer);//socket watch httpserver

wsServer.on('connection',function (sock) {  // when this server is connected,sock  
    sock.on('a',function (p1,p2) {  
        console.log(p1,p2);
    });
});